<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="stylesheet" href="../../css/style.css">
    <link rel="stylesheet" href="../../css/deliver.css">
    <title>发货</title>

</head>
<body>

    <div class="configNav"></div>
    <!-- content -->
    <div class="container-fluid">
        <div class="row">
            <!-- left -->
            <div class="col-md-2">
                <div class="list-group">
                    <a href="order_index.html" class="list-group-item ">交易订单</a>
                    <a href="deliver_index.html" class="list-group-item active">发货</a>
                    <a href="address.html" class="list-group-item ">发货设置</a>
                    <a href="evaluate_admin.html" class="list-group-item ">评价管理</a>
                </div>
            </div>
            <!-- right -->
            <div class="col-md-10">
                <ol class="breadcrumb">
                    <li><a href="">商家管理中心</a></li>
                    <li><a href="">订单物流</a></li>
                    <li class="active"><a href="">发货</a></li>
                </ol>
               <ul class="nav nav-tabs" >
                <li class="chose"><a href="deliver_index.html">待发货</a></li>
                <li><a href="deliver_transport.html">发货中</a></li>
                <li><a href="deliver_end.html">已收货</a></li>

               </ul>
               <div class="alert alert-warning">
                   <p>1、可以对待发货的订单进行发货操作，发货时可以设置收货人和发货人的信息，填写一些备忘信息，选择相应的物流服务，打印发货单。</p>
                   <p>2、已经设置为发货的订单中，您还可以继续编辑上次的发货信息。</p>
                   <p>3、如果因物流等原因造成买家不能及时收货，您可使用点击延迟收货按钮来延迟系统的自动收货时间。</p>
               </div>
               <div id="search">
                <form class="form-inline col-md-10">
                        <div class="form-group">
                            <label for="">下单时间</label>
                            <div class="input-group date form_date_str"  data-date="" data-date-format="dd MM yyyy"  data-link-format="yyyy-mm-dd">
                                <input class="sreenMedia" type="text" value="" readonly id="startTime">
                                <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
                            </div>
                            -
                            <div class="input-group date form_date_end"  data-date="" data-date-format="dd MM yyyy"  data-link-format="yyyy-mm-dd">
                                <input  class="sreenMedia" type="text" value="" readonly id="endTime">
                                <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
                            </div>
                            <label for="">买家
                                <input class="sreenMedia" type="text" id="searchBuyerName">
                            </label>
                            <label for="">订单编号
                                <input class="sreenMedia" type="text" id="searchOrderSn">
                            </label>
                        </div>

                </form>
                    <button style="width:70px;" class="searchBtn">搜索</button>
            </div>

            <hr>
            <table class="table table-bordered" id="stayGoods">

             </table>

            <nav aria-label="...">
                <div class="">
                  <span id="pageNum">共&nbsp;<strong></strong>&nbsp;页&nbsp;/&nbsp;</span><span id="totalNum">&nbsp;<strong>0</strong>&nbsp;条数据</span>
                </div>
                <ul id="example"></ul>
              </nav>
            </div>
        </div>
    </div>

    <script src="../../js/jquery.min.js" charset="utf-8"></script>
    <script src="../../js/bootstrap.min.js" charset="utf-8"></script>
    <script src="../../plugin/layer/layer.js" charset="utf-8"></script>
    <script src="../../plugin/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js" charset="utf-8"></script>
    <script src="../../plugin/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js" charset="utf-8"></script>
    <script src="../../plugin/wangEditor/release/wangEditor.min.js" charset="utf-8"></script>
    <script src="../../js/nav.js" charset="utf-8"></script>
    <script src="../../js/common.js" charset="utf-8"></script>
    <script src="../../js/bootstrap-paginator.js" charset="utf-8"></script>
    <script src="../../js/ajax.js" charset="utf-8"></script>
    <script>

          //时间
          $(".form_date_str").datetimepicker({
    　    minView: "month", 
        　format: "yyyy-mm-dd", 
        　language: 'zh-CN', 
        　autoclose:true 
        });
        $(".form_date_end").datetimepicker({
        　minView: "month", 
        　format: "yyyy-mm-dd", 
        　language: 'zh-CN',
        　autoclose:true 
        });
        $(document).ready(function(){
                tableList()
            });

              //查询待发货订单
               var pageUrls =cncbk_common_tools.serverURL + '/business/order/queryExpressOrder';
        	function tableList(){
               
                var buyerName = $('#buyerName').val();
                var orderSn=$('#orderSn').val();

                    //分页
                data = {
                    'orderStatus':2,
                    'page': page,
                    'pageSize': pagesize
                }
                data.page = 1
                ajax(
                    pageUrls,
                    data,
                    pageNumList,
                    'post',
                    'json'
                )
           }

        //数据渲染
       function OpendList(res){
           $('#stayGoods').empty();
           var html ='';
           for (var i = 0; i < res.data.list.length; i++) {
              html +='<thead>'+
                '<tr >'+
                '<th class="col-md-5" goods="'+res.data.list[i].goodsId +'"><span id="orderSn">订单编号:<span>'+res.data.list[i].orderSn+'</span></span><span>下单时间:<time>'+res.data.list[i].orderTime+'</time></span></th>'+
                '<th class="col-md-6"> <button type="submit" class="orderPrint" orderDetailId="'+res.data.list[i].orderDetailId+'"  style="float:right;"><i class="glyphicon glyphicon-print"></i>打印发货单</button>  <button type="submit" class="logistics"  orderDetailId="'+res.data.list[i].orderDetailId+'" style="float:right;margin-right:10px;"><i class="glyphicon glyphicon-print"></i>查看物流</button> </th>'+
                '</tr>'+
                '</thead>'+
                '<tbody>'+
                '<tr>'+
                '<td class="col-md-5 goodsLi">'+
                '<ul >'+
                '<li class="goodsimg"><img src="http://axyhpic.oss-cn-zhangjiakou.aliyuncs.com/'+res.data.list[i].goodsImage +'" alt=""></li>'+
                '<li>'+
                '<span class="goodsName"><a href="http://47.92.118.122/html/wytx/goods_particulars.html?id='+res.data.list[i].goodsId +'">'+res.data.list[i].goodsName+'</a></span><br>'+
                '<span> <strong style="color:#f00;">￥'+res.data.list[i].goodsPrice+'元</strong> x <span>'+res.data.list[i].goodsQuantity+'</span> 件</span>'+
                '</li>'+
                '</ul>'+
                '</td>'+
                '<td class="col-md-6">'+
                '<ul>'+
                '<li>买家：<span id="buyerName">'+res.data.list[i].buyerName+'</span></li>'+
                '<li>收货人：'+
                '<div><span><i class="glyphicon glyphicon-user"></i>'+res.data.list[i].name+'</span><span><i i class="glyphicon glyphicon-earphone"></i>'+res.data.list[i].phone+'</span><br>'+
                '<span><i class="glyphicon glyphicon-map-marker"></i>'+res.data.list[i].province +res.data.list[i].city+res.data.list[i].country + res.data.list[i].town  +res.data.list[i].address+'</span>'+
                '</div>'+
                '</li>'+
                '<li>运费：￥<span class="goodsFreight">'+res.data.list[i].goodsFreight+'元</span></li>'+
                '</ul>'+
                '<button class="btn-revise deliverJump" style="float:right;" orderDetailId="'+res.data.list[i].orderDetailId+'"> <i class="glyphicon glyphicon-plane"></i>设置发货</button>'+
                '</td>'+
                '</tr>'+
                '</tbody>';

           }
           $('#stayGoods').append(html);

           //搜索
           $('.searchBtn').click(function(){
            var pageUrls =cncbk_common_tools.serverURL + '/business/order/queryExpressOrder';
            var startTime = $('#startTime').val();
            var endTime = $('#endTime').val();
            var buyerName = $('#searchBuyerName').val();
            var orderSn = $('#searchOrderSn').val();

            data={
                'startTime':startTime,
                'endTime':endTime,
                'buyerName':buyerName,
                'orderSn':orderSn,
                'orderStatus':2,
                'page':1,
                'pageSize':10
            }
            ajax(
                pageUrls,
                data,
                pageNumList,
                'post',
                'json'
            )
           })

           //查看物流的跳转
           $(function(){
               $('.logistics').click(function(){
                    window.location.href="deliver_logistics.html?orderDetailId="+ $(this).attr('orderDetailId');
               })
           })
             //打印发货单跳转
             $('.orderPrint').click(function(){
                window.location.href = "order_print.html?orderDetailId="+ $(this).attr('orderDetailId');
            })
              //设置发货跳转
              $('.deliverJump').click(function(){
                window.location.href = "deliver_set.html?orderDetailId="+ $(this).attr('orderDetailId');
            })
       }
    </script>
</body>
</html>
